package com.lebang.domain;

import com.lebang.entity.RequestHeaders;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * active_member
 * @author 
 */
@Data
@ApiModel("")
public class ActiveMember implements Serializable {
    /**
     * 自增id
     */
    @ApiModelProperty("自增id")
    private Long id;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    /**
     * 设备号
     */
    @ApiModelProperty("设备号")
    private String imei;

    /**
     * 渠道
     */
    @ApiModelProperty("渠道")
    private String appStore;

    /**
     * 系统版本
     */
    @ApiModelProperty("系统版本")
    private String osVersion;

    /**
     * 机型
     */
    @ApiModelProperty("机型")
    private String osv;

    /**
     * 创建日期
     */
    @ApiModelProperty("创建日期")
    private LocalDate createDate;

    /**
     * ip所在省
     */
    @ApiModelProperty("ip所在省")
    private String ipProvince;

    /**
     * ip所在市
     */
    @ApiModelProperty("ip所在市")
    private String ipCity;

    /**
     * 版本号
     */
    @ApiModelProperty("版本号")
    private Integer version;

    /**
     * ip
     */
    @ApiModelProperty("ip")
    private String ip;

    /**
     * 城市
     */
    @ApiModelProperty("城市")
    private String city;

    private static final long serialVersionUID = 1L;

    public ActiveMember() {
    }

    public ActiveMember(RequestHeaders requsetHeader) {
        LocalDateTime now = LocalDateTime.now();
        this.createTime = now;
        this.imei = requsetHeader.getImei();
        this.appStore = requsetHeader.getAppStore();
        this.osVersion = requsetHeader.getOsVersion();
        this.osv = requsetHeader.getOsv();
        this.createDate = now.toLocalDate();
        this.version= requsetHeader.getVersionInt();
        this.ip = requsetHeader.getIpAddr();
    }

}